package main

import (
	"errors"
	"fmt"
)

func pErr() {
	r := errors.New("this is new error")
	if r != nil {
		panic(r)
	}
}

func main() {

	defer func() {
		//a := recover()
		//if err, ok := a.(error); ok {
		//	fmt.Println(err)
		//}
		if a2 := recover(); a2 != nil {
			fmt.Println(a2)
		}
	}()
	pErr()

}
